package com.me.crgame.transiciones;

import static com.badlogic.gdx.scenes.scene2d.actions.Actions.sequence;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.scenes.scene2d.Action;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.actions.Actions;
import com.me.crgame.core.Director;
import com.me.crgame.core.Transicion;


public class TransicionX extends Transicion{
	
	Actor a;
	
	public TransicionX() {
		super();
		a = new Actor();
		//super.setBackground("data/sistema_menus/transiciones/black.png");
	}

	@Override
	protected void empiezaLaEscena(int transitionMode) {
		
		if (transitionMode == 1) {
			
			Gdx.app.log("CRGame", "3");
			Director.getInstance().transicionFinalizada(3);
			
		}

		if (transitionMode == 4) {
			
			super.addAction(sequence(Actions.delay(2.5f), new Action() {
				@Override
				public boolean act(float delta) {
					// Cuando finalmente el fondo de la pantalla desaparezca
					// se cambiara de screen
					Gdx.app.log("CRGame", "4");
					Director.getInstance().transicionFinalizada(4);
					return true;
				}
			}));
			
			
		}
		
	}

	@Override
	protected void pause(boolean gamePaused) {
		// TODO Auto-generated method stub
		
	}

	@Override
	protected void update(float deltaTime) {
		// TODO Auto-generated method stub
		
	}

	
	
	
}
